<?php

include "config.php";

$sql = "SELECT photo_id, latitude, longitude, caption, location FROM photos WHERE photo_status='public' AND latitude != '' AND longitude != ''";
$query = mysql_query($sql);
$points = array();
while($result = mysql_fetch_assoc($query))
{
	array_push($points, array(
								$result['latitude'], 
								$result['longitude'], 
								$result['location'], 
								$result['caption']
							));
}
echo json_encode($points);
//$result = mysql_fetch_assoc($query);
//echo json_encode($result);
?>